#ifndef EncryptionImpl_H
#define EncryptionImpl_H

#include "common_types.h"
#include "jni_api.h"

class EncryptionImpl : public webrtc::Encryption, public JniCallbackGlobal
{
public:
	EncryptionImpl(void);
	~EncryptionImpl(void);

protected:	//JniCallbackBase
	virtual bool init_jni(JNIEnv* env);

public:
	virtual void encrypt(
		int channel,
		unsigned char* in_data,
		unsigned char* out_data,
		int bytes_in,
		int* bytes_out);

	virtual void decrypt(
		int channel,
		unsigned char* in_data,
		unsigned char* out_data,
		int bytes_in,
		int* bytes_out);

	virtual void encrypt_rtcp(
		int channel,
		unsigned char* in_data,
		unsigned char* out_data,
		int bytes_in,
		int* bytes_out);

	virtual void decrypt_rtcp(
		int channel,
		unsigned char* in_data,
		unsigned char* out_data,
		int bytes_in,
		int* bytes_out);

protected:
	jmethodID m_mid_encrypt;
	jmethodID m_mid_decrypt;
	jmethodID m_mid_encrypt_rtcp;
	jmethodID m_mid_decrypt_rtcp;
};

#endif //!EncryptionImpl_H
